package com.canpany.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.canpany.dao.DoLink;

public class AddProduct extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String serialNumber=request.getParameter("serialNumber");
		String name=request.getParameter("name");
		String brand=request.getParameter("brand");
		String model=request.getParameter("model");
		String price=request.getParameter("price");
		String picture=request.getParameter("picture");
		String description=request.getParameter("description");
		DoLink dao=new DoLink();
		dao.insertProduct(serialNumber, name, brand, model, price, picture, description);
		
		
		response.sendRedirect("admin/manageProduct.jsp");
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}
	
	
}
